home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio 2000
/
Ham Radio 2000.iso
/
ham2000
/
tcp_ip
/
gp
/
7plus.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-21
|
4KB
|
186 lines
/*---------*\
> 7plus.h <
\*---------*/
#define YES "y"
#define NO "n"
#define EOS '\0'
/* Uncomment next line, if compiling on AMIGA! */
/* #define _AMIGA_ */
/** these includes should work anywhere **/
#include <stdio.h>
#include <string.h>
#ifdef M_XENIX
#include <malloc.h>
#define SEEK_CUR 1
#define SEEK_END 2
#define SEEK_SET 0
typedef unsigned size_t;
#else
#include <stdlib.h>
#endif
#include <ctype.h>
/** #defines, depending on the system and compiler **/
/* flags for fopen() */
#define OPEN_READ_TEXT "r"
#define OPEN_WRITE_TEXT "w"
#define OPEN_APPEND_TEXT "a"
#ifdef __unix__
#define OPEN_READ_BINARY "r"
#define OPEN_WRITE_BINARY "w"
#define OPEN_APPEND_BINARY "a"
#else
#define OPEN_READ_BINARY "rb"
#define OPEN_WRITE_BINARY "wb"
#define OPEN_APPEND_BINARY "ab"
#endif
/* Microsoft's Quick C has some different makros and function names **/
#ifdef _QC
#define __MSDOS__
#define MAXDRIVE _MAX_DRIVE
#define MAXDIR _MAX_DIR
#define MAXFILE _MAX_FNAME
#define MAXEXT _MAX_EXT
#define MAXPATH _MAX_PATH
#define fnsplit _splitpath
#endif
#ifdef __MSDOS__
#ifdef __TURBOC__
#include <dir.h>
#endif
#include <conio.h>
#define PATHSEP "\\"
#define PATHCHAR '\\'
#define INDICATE 0xdb
#define MAXFNAME MAXFILE+MAXEXT-1
#endif
#ifdef _AMIGA_
#undef YES
#define YES ""
#undef NO
#define NO ""
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#define MAXPATH 300
#define MAXDRIVE 5
#define MAXDIR 220
#define MAXFILE 31
#define MAXEXT 31
#define PATHSEP "/"
#define PATHCHAR '/'
#define INDICATE '*'
#define MAXFNAME MAXFILE
#define _FNSPLIT
#define _ICMP
#define getch getchar
#endif
#ifdef __TOS__
#define MAXPATH 119
#define MAXDRIVE 3
#define MAXDIR 102
#define MAXFILE 9
#define MAXEXT 5
#define PATHSEP "\\"
#define PATHCHAR '\\'
#define INDICATE 0xdb
#define MAXFNAME MAXFILE+MAXEXT-1
#define _FNSPLIT
#include <ext.h>
#endif
#ifdef __unix__
/* assumed limits (hope reasonable !!!) */
#define ON 0
#define OFF 1
#define MAXPATH 256
#define MAXDRIVE 16
#define MAXDIR 256
#define MAXFILE 32
#define MAXEXT 32
#define PATHSEP "/"
#define PATHCHAR '/'
/*
#ifdef M_XENIX
#define INDICATE 0xdb
#else
*/
#define INDICATE '*'
/*
#endif
*/
#define MAXFNAME MAXFILE
#define _ICMP
#define _FNSPLIT
#define getch my_getch
#ifdef __i386__
#define SYSV
#endif
#ifdef SYSV
#include <termio.h>
struct termio sg[2];
#else
#include <sgtty.h>
struct sgttyb sg[2];
#endif
#endif /* __unix__ */
#define MAXFPATH MAXDRIVE+MAXDIR-1
/** shorthands for unsigned types **/
typedef unsigned char byte; /* 8bit unsigned char */
typedef unsigned int uint; /* 16 or 32bit unsigned int */
typedef unsigned long ulong; /* 32bit unsigned long */
/** function prototypes **/
int go_at_it (int argc, char **argv);
void init_crctab (void);
void init_decodetab (void);
void init_codetab (void);
void crc_n_lnum (uint *crc, int *linenumber, char *line);
void crc2 (uint *crc, char *line);
void add_crc2 (char *line);
void kill_dest (FILE *in, FILE *out, char *name);
void test_file (FILE *rein, char *destnam, int flag, int namsize);
void build_DOS_name (char *name);
int crc_file (char *file, char *s1, char *s2, int flag);
int mcrc (char *line, int flag);
int test_exist (char *filename);
int control_decode (char *name);
int decode_file (char *name);
int encode_file (char *name, long blocksize, char *searchbin);
int join_control (char *file1, char *file2);
int join_err (char *file1, char *file2);
int extract_files (char *name, char *search);
char *my_fgets (char *string, register n, FILE *rein);
int my_putc (int outchar, FILE *out);
uint get_hex (char *hex);
int rebuild (char *line, int flag);
#ifdef _FNSPLIT
void fnsplit (char *pth,char *dr,char *pa,char *fn,char *ft);
#endif
#ifdef _ICMP
char *strupr (char *string);
char *strlwr (char *string);
int stricmp (char *s1, char *s2);
int strnicmp (char *s1, char *s2, int n);
#endif
#ifdef __unix__
int my_getch (void);
char *strstr (char *s1, char *s2);
#endif